#7
class add_two_num(object):
    def add_two_list(self, num_lists):
        nums = []
        num = 0
        for num_list in num_lists:
            for i in len(num_list):
                num += a ** 10
        return num




class ListNode(object):

    def __init__(self, x):
        self.val = x
        self.next = None


class Solution(object):
    def addTwoNumbers(self, l1, l2):
        carry = 0
        root = n = ListNode(0)
        while l1 or l2 or carry:
            v1 = v2 = 0
            if l1:
                v1 = l1.val
                l1 = l1.next
            if l2:
                v2 = l2.val
                l2 = l2.next
            carry, val = divmod(v1 + v2 + carry, 10)
            print(carry, val)
            n.next = ListNode(val)
            n = n.next
        return root.next


l1 = ListNode(7)
l1.next = ListNode(5)
l1.next = ListNode(4)

l2 = ListNode(3)
l2.next = ListNode(1)
l2.next = ListNode(2)



s = Solution()
while s.next is not  None:
    print(s.val)
    s = s.next



